package com.justgame.project.cloud.common.util;

import java.util.Random;

public class RandomStringUtil {
    private static final String[] ADJECTIVES = {"可爱的", "活泼的", "勇敢的", "聪明的", "美丽的", "友好的", "快乐的", "幸福的", "高冷的", "调皮的", "勇敢的"};
    private static final String[] NOUNS = {"小兔", "小狗", "小猫", "小鸟", "小鹿", "小花", "小蝴蝶", "小公主", "小国王", "小工程师", "小科学家",
            "小探险家", "小医生", "小猎人", "小作家", "小画家", "小音乐家", "小舞者", "小演员", "小歌手", "小推销员", "小记者", "小教师", "小律师", "小警察",
            "小消防员", "小护士", "小厨师", "小经理", "小老板", "小秘书", "小邮递员", "小司机", "小农夫", "小商人", "小清洁工", "小技工", "小环保人员"};
    private static final Random RANDOM = new Random();

    public static String Nickname() {
        return ADJECTIVES[RANDOM.nextInt(ADJECTIVES.length)] + NOUNS[RANDOM.nextInt(NOUNS.length)];
    }

    public static String Number(int length){
        if (length <= 0) {
            throw new IllegalArgumentException("length must be greater than zero");
        }
        StringBuilder sb = new StringBuilder(length);
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            sb.append(random.nextInt(10));
        }
        return sb.toString();
    }
}
